/** @file font.c
 *
 * @author cameris camerisdump@gmail.com
 */

#include "font.h"
#include "terminal.h"
#include "color.h"
#include "lcd.h"

/** @brief selected font slots G0, G1, G2, G3 */
uint8_t fontselected[MAX_SELECT] = {
	FONT_ASCII,
	FONT_ASCII,
	FONT_LATIN1,
	FONT_LATIN1,
};

/** @brief active font slots GL, GR */
uint8_t fontactive[MAX_ACTIVE] = {
	G0,
	G2,
};

enum selectslot glssreturn = NO_SS;

enum selectslot glsave = G0;
enum selectslot grsave = G2;
enum selectslot glsssave = NO_SS;

/* font C0 (with SP and DEL) {{{ */
const __flash uint8_t font_c0[] = {
    0x02, 0x6B, 0x08, 0x0F, 0x01, 0x00, 0x7F,
    0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x08, 0x06, 
    0x08, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x08, 0x08, 0x08, 
    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 
    
    0x3E, 0x00, 0x02, 0x00, 0x72, 0xC0, 0x47, 0x00, 0x20, 0x00, 0xEE, 0x01, 0x80, 0x00, 0x40, 0x24, 
    0x00, 0x15, 0x80, 0x7A, 0x40, 0x46, 0x00, 0xE2, 0x03, 0x4E, 0x00, 0x20, 0x00, 0x7C, 0x24, 0x00, 
    0x15, 0x80, 0x1A, 0x40, 0x0A, 0x00, 0x7C, 0x00, 0xB2, 0x01, 0x21, 0x00, 0x6C, 0x3E, 0x00, 0x15, 
    0x80, 0x1A, 0x40, 0x0C, 0x00, 0x7C, 0x00, 0xB2, 0x01, 0x21, 0x00, 0x6C, 0x3E, 0x00, 0x15, 0x80, 
    0x7A, 0x40, 0xC4, 0x00, 0x62, 0x00, 0xEE, 0x01, 0x10, 0x00, 0x08, 0x3E, 0x00, 0x15, 0x80, 0xFA, 
    0x40, 0x0C, 0x00, 0xC8, 0x01, 0x1F, 0x01, 0xC8, 0x00, 0x78, 0x1C, 0x00, 0x05, 0x80, 0x72, 0x80, 
    0x47, 0x00, 0x22, 0x00, 0xF0, 0x01, 0x60, 0x00, 0x48, 0x3E, 0x00, 0x15, 0x80, 0xFA, 0x80, 0x56, 
    0x00, 0x2A, 0x00, 0xF1, 0x01, 0x80, 0x00, 0x40, 0xFC, 0x01, 0x92, 0x00, 0x49, 0x00, 0x3B, 0x01, 
    0x24, 0x01, 0x92, 0x00, 0x32, 0xF8, 0x03, 0x20, 0x00, 0x10, 0x00, 0x7F, 0x00, 0x10, 0x00, 0xF8, 
    0x01, 0x04, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x01, 0x80, 0x00, 0xF0, 0x07, 0x48, 0x00, 0x24, 0x00, 
    0x02, 0x30, 0x00, 0xE0, 0x00, 0x80, 0x01, 0x78, 0x00, 0x23, 0x00, 0xF0, 0x03, 0x08, 0x00, 0x04, 
    0xF0, 0x07, 0x48, 0x00, 0x24, 0x00, 0xE2, 0x0F, 0x90, 0x00, 0x48, 0x00, 0x04, 0xC0, 0x07, 0x10, 
    0x04, 0x08, 0x02, 0x04, 0x01, 0xE4, 0x0F, 0x90, 0x00, 0xC8, 0x00, 0x98, 0xC1, 0x04, 0x90, 0x04, 
    0x48, 0x02, 0x24, 0x1F, 0x64, 0x10, 0x20, 0x08, 0x10, 0x04, 0xF0, 0xC1, 0x04, 0x90, 0x04, 0x48, 
    0x02, 0xC8, 0x00, 0x00, 0x00, 0xC0, 0xCF, 0x03, 0x20, 0x01, 0x90, 0x0F, 0x30, 0x04, 0x00, 0x02, 
    0x00, 0x3E, 0x00, 0x15, 0x80, 0xC8, 0x03, 0x20, 0x01, 0x90, 0x0E, 0xB0, 0x08, 0x40, 0x04, 0x00, 
    0x04, 0x00, 0x9F, 0x07, 0x40, 0x02, 0x20, 0x1D, 0x60, 0x11, 0x80, 0x98, 0x00, 0x64, 0x00, 0x2A, 
    0x00, 0x92, 0x07, 0x40, 0x02, 0x20, 0x1D, 0x60, 0x11, 0x80, 0x88, 0x00, 0x54, 0x00, 0x2A, 0x00, 
    0x8A, 0x07, 0x40, 0x02, 0x20, 0x1D, 0x60, 0x11, 0x80, 0x68, 0x00, 0x28, 0x00, 0x3E, 0x00, 0x88, 
    0x07, 0x80, 0x00, 0x80, 0x38, 0xF0, 0x0B, 0x80, 0x05, 0x00, 0x7F, 0x00, 0x18, 0x00, 0x12, 0x09, 
    0x40, 0x05, 0xA0, 0x06, 0x90, 0x04, 0x00, 0xFC, 0x00, 0x11, 0x40, 0x10, 0x00, 0x9E, 0x0F, 0x40, 
    0x05, 0xA0, 0x06, 0x10, 0x03, 0x00, 0xFF, 0x80, 0x54, 0x40, 0x2A, 0x00, 0x0A, 0x07, 0x40, 0x04, 
    0x20, 0x3A, 0x00, 0x0B, 0x80, 0xF5, 0x00, 0x1F, 0x00, 0x10, 0x00, 0x1E, 0x7F, 0x80, 0x24, 0x40, 
    0x12, 0x20, 0xFD, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x03, 0xC0, 0x0F, 0x09, 0x40, 0x05, 0xA0, 0x3E, 
    0x90, 0x20, 0x00, 0xF8, 0x80, 0x57, 0x00, 0x2A, 0x00, 0x8A, 0x0F, 0x40, 0x05, 0xA0, 0x26, 0x10, 
    0x15, 0x80, 0x0A, 0x40, 0x3A, 0x00, 0x22, 0x00, 0x11, 0x7F, 0x80, 0x04, 0x40, 0x02, 0x20, 0x4C, 
    0x00, 0x49, 0x80, 0x24, 0x80, 0x0C, 0x7C, 0x00, 0x41, 0x80, 0x24, 0x80, 0x0E, 0x00, 0x4C, 0x00, 
    0x49, 0x80, 0x24, 0x80, 0x0C, 0xFE, 0x00, 0x09, 0x80, 0x04, 0x80, 0x1D, 0x00, 0x4C, 0x00, 0x49, 
    0x80, 0x24, 0x80, 0x0C, 0x7E, 0x00, 0x40, 0x00, 0x20, 0xC0, 0x0F, 0x00, 0x4C, 0x00, 0x49, 0x80, 
    0x24, 0x80, 0x0C, 0x00, 0x80, 0x07, 0x40, 0x02, 0x20, 0x3F, 0x60, 0x15, 0x80, 0x0A, 0x00, 0x7C, 
    0x00, 0x20, 0x00, 0x10
};
/* }}} */
/* font C1 {{{ */
const __flash uint8_t font_c1[] = {
    0x01, 0xF7, 0x08, 0x0F, 0x01, 0x00, 0x1F,
    0x08, 0x08, 0x08, 0x08, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x08, 0x08, 
    0x08, 0x07, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x08, 0x08, 0x07, 
    
    0x3E, 0x00, 0xC5, 0x81, 0x5A, 0x80, 0x2C, 0x00, 0xF8, 0x03, 0x10, 0x01, 0x88, 0x00, 0x38, 0x3E, 
    0x00, 0x04, 0x00, 0x72, 0xC0, 0x47, 0x00, 0xE2, 0x03, 0x5E, 0x00, 0x28, 0x00, 0x08, 0x3E, 0x00, 
    0x15, 0x80, 0x0A, 0x80, 0x7E, 0x00, 0xEA, 0x03, 0x45, 0x00, 0x21, 0x00, 0x7C, 0x1E, 0x00, 0x02, 
    0x00, 0xFA, 0xC0, 0x57, 0x00, 0xEA, 0x03, 0x4A, 0x00, 0x20, 0x00, 0x7C, 0x3E, 0x00, 0xF0, 0x00, 
    0x10, 0x00, 0xD0, 0x07, 0x3E, 0x02, 0x10, 0x01, 0x70, 0x3C, 0x00, 0x04, 0x00, 0xF4, 0x81, 0xAF, 
    0x00, 0x54, 0x00, 0xE2, 0x03, 0x00, 0x01, 0x80, 0x48, 0x00, 0x2A, 0x00, 0x35, 0x81, 0xAC, 0x00, 
    0x54, 0x07, 0x72, 0x01, 0xB0, 0x00, 0xE0, 0x7C, 0x00, 0x2A, 0x00, 0x35, 0x81, 0xA8, 0x00, 0x54, 
    0x07, 0x72, 0x01, 0xB0, 0x00, 0xE0, 0x7C, 0x00, 0x08, 0x00, 0x14, 0x80, 0x0F, 0x00, 0xFC, 0x04, 
    0xA2, 0x02, 0x51, 0x01, 0x48, 0x7C, 0x00, 0x08, 0x00, 0x14, 0x80, 0x0F, 0x00, 0x7C, 0x02, 0x02, 
    0x02, 0x01, 0x01, 0x7C, 0x0C, 0x00, 0x38, 0x00, 0x1C, 0x80, 0x09, 0x00, 0xFC, 0x04, 0xA2, 0x02, 
    0x51, 0x01, 0x48, 0x7C, 0x00, 0x0A, 0x00, 0xF5, 0x01, 0x81, 0x00, 0xC0, 0x07, 0x20, 0x02, 0x10, 
    0x01, 0x70, 0x7C, 0x00, 0x0A, 0x00, 0xF5, 0x01, 0x81, 0x00, 0xC0, 0x03, 0x00, 0x02, 0x00, 0x01, 
    0x78, 0xF8, 0x03, 0x24, 0x00, 0x12, 0x00, 0x76, 0x00, 0x00, 0x00, 0xF0, 0x23, 0x01, 0xA8, 0x00, 
    0xD4, 0x04, 0xB2, 0x02, 0x50, 0x13, 0xC8, 0x0C, 0x40, 0x05, 0x40, 0x22, 0x01, 0xA8, 0x00, 0xD4, 
    0x04, 0xB2, 0x02, 0x50, 0x11, 0xC8, 0x0A, 0x40, 0x05, 0x40, 0xF1, 0x01, 0x88, 0x00, 0xC4, 0x03, 
    0x3C, 0x02, 0x10, 0x13, 0x80, 0x0A, 0x40, 0x05, 0x20, 0xF1, 0x01, 0x28, 0x00, 0xD4, 0x03, 0x04, 
    0x02, 0x00, 0x01, 0x78, 0x01, 0xC0, 0xE7, 0x03, 0x50, 0x00, 0xA8, 0x07, 0x08, 0x04, 0x00, 0x26, 
    0xF0, 0x19, 0x80, 0x0A, 0x80, 0x44, 0x02, 0x50, 0x01, 0xA8, 0x01, 0xE4, 0x00, 0xC0, 0x27, 0x20, 
    0x15, 0x90, 0x0A, 0x40, 0xC2, 0x01, 0x10, 0x01, 0x88, 0x07, 0x40, 0x04, 0x20, 0x3E, 0x00, 0x04, 
    0x00, 0x02, 0xC0, 0xC7, 0x1F, 0x40, 0x00, 0xC0, 0x00, 0x10, 0x0F, 0xFC, 0x19, 0x00, 0x03, 0x00, 
    0x06, 0xF0, 0x40, 0x02, 0x50, 0x01, 0xA8, 0x0F, 0x64, 0x71, 0xA0, 0x16, 0x20, 0x0B, 0x00, 0xCE, 
    0x07, 0xA0, 0x02, 0x50, 0x1F, 0x88, 0xE2, 0x40, 0x2D, 0x40, 0x16, 0x00, 0x1C, 0x09, 0x40, 0x05, 
    0xA0, 0x1E, 0x90, 0x11, 0x80, 0x98, 0x80, 0x57, 0x00, 0x2A, 0x00, 0x09, 0x09, 0x40, 0x05, 0xA0, 
    0x1E, 0x90, 0x11, 0x80, 0x0A, 0x40, 0x07, 0x00, 0x3E, 0x12, 0x80, 0x0A, 0x40, 0x05, 0x20, 0x1F, 
    0x00, 0x11, 0x80, 0x08, 0x00, 0x00, 0x00, 0x3E, 0x0E, 0x80, 0x08, 0x40, 0x4C, 0x20, 0x2A, 0x00, 
    0x15, 0x80, 0x04, 0x00, 0x7C, 0x98, 0x00, 0x92, 0x00, 0x49, 0x00, 0x19, 0x00, 0x08, 0x00, 0xFC, 
    0x00, 0x02, 0x00, 0x01, 0x1C, 0x00, 0x11, 0x80, 0x98, 0x80, 0x57, 0x00, 0x2A, 0x00, 0xE9, 0x00, 
    0x88, 0x00, 0x44, 0xFC, 0x01, 0x12, 0x00, 0x09, 0x80, 0xF4, 0x83, 0x11, 0x00, 0x30, 0x00, 0x04, 
    0x00, 0x3F, 0x78, 0x00, 0x0B, 0x80, 0xF5, 0x01, 0x2F, 0x00, 0xDC, 0x01, 0x10, 0x01, 0x88, 0x00, 
};
/* }}} */
/* font ascii {{{ */
const __flash uint8_t font_ascii[] = {
    0x04, 0x6C, 0x08, 0x0F, 0x01, 0x21, 0x7E,
    0x01, 0x03, 0x08, 0x07, 0x07, 0x07, 0x01, 0x03, 0x03, 0x07, 0x07, 0x03, 0x03, 0x02, 0x06, 0x07, 
    0x05, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, 0x03, 0x07, 0x07, 0x07, 0x05, 0x07, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x05, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x06, 0x03, 0x07, 0x08, 0x02, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x05, 0x04, 0x06, 0x06, 0x07, 0x06, 0x06, 0x06, 
    0x06, 0x05, 0x06, 0x06, 0x06, 0x05, 0x07, 0x05, 0x06, 0x06, 0x05, 0x01, 0x05, 0x07, 
    0xF8, 0x0D, 0x3C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x72, 0x00, 0x0F, 0xE0, 0x04, 0x40, 
    0x0E, 0xE0, 0x01, 0x9C, 0x00, 0x08, 0x00, 0x46, 0x80, 0x44, 0x40, 0x22, 0xF0, 0x7F, 0x10, 0x09, 
    0x88, 0x04, 0x88, 0x01, 0x06, 0x80, 0x14, 0x40, 0x0A, 0xC0, 0x1A, 0x00, 0x13, 0x40, 0x09, 0x20, 
    0x03, 0xE0, 0x01, 0x8E, 0x81, 0x84, 0x40, 0x4C, 0x20, 0x2C, 0x00, 0x08, 0x80, 0x0B, 0x3C, 0x00, 
    0xFC, 0x80, 0x81, 0x21, 0x00, 0x11, 0x80, 0x30, 0x30, 0xE0, 0x07, 0x90, 0x00, 0x50, 0x00, 0x18, 
    0x00, 0x3F, 0x00, 0x06, 0x00, 0x05, 0x40, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xFC, 0x01, 
    0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x80, 0x00, 0x38, 0x00, 0x0C, 0x40, 0x00, 0x20, 0x00, 0x10, 
    0x00, 0xC0, 0x00, 0x60, 0x00, 0x80, 0x00, 0x30, 0x00, 0x06, 0xE0, 0x00, 0x0C, 0x00, 0x01, 0x00, 
    0x3E, 0x80, 0x20, 0x20, 0x20, 0x10, 0x11, 0x08, 0x08, 0x08, 0x02, 0xF8, 0x00, 0x01, 0x81, 0x80, 
    0xC0, 0x7F, 0x00, 0x20, 0x00, 0x10, 0x10, 0x0C, 0x04, 0x05, 0x42, 0x02, 0x21, 0x81, 0x88, 0x40, 
    0x44, 0xC0, 0x21, 0x20, 0x08, 0x08, 0x08, 0x44, 0x04, 0x22, 0x02, 0x11, 0x81, 0x94, 0x80, 0x3B, 
    0x00, 0x0C, 0x00, 0x05, 0x40, 0x02, 0x18, 0x01, 0x82, 0x00, 0xFF, 0x01, 0x20, 0xC0, 0x23, 0x20, 
    0x21, 0x90, 0x10, 0x48, 0x08, 0x24, 0x04, 0x22, 0x01, 0x60, 0x00, 0x3E, 0x80, 0x24, 0x20, 0x21, 
    0x90, 0x10, 0x48, 0x08, 0x24, 0x04, 0xE4, 0x01, 0x01, 0x80, 0x80, 0x40, 0x20, 0x20, 0x0C, 0x90, 
    0x01, 0x28, 0x00, 0x0C, 0x00, 0xDC, 0x01, 0x11, 0x81, 0x88, 0x40, 0x44, 0x20, 0x22, 0x10, 0x11, 
    0x70, 0x07, 0x78, 0x02, 0x42, 0x02, 0x21, 0x81, 0x90, 0x40, 0x48, 0x40, 0x12, 0xC0, 0x07, 0x60, 
    0x0C, 0x30, 0x06, 0x00, 0x08, 0x8C, 0x03, 0xC6, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x03, 0x40, 0x02, 
    0x20, 0x01, 0x90, 0x00, 0x84, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x80, 0x04, 0x40, 0x02, 0x20, 
    0x01, 0x90, 0x00, 0x84, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x00, 
    0x04, 0x00, 0x01, 0x80, 0xD8, 0x40, 0x02, 0xC0, 0x00, 0x80, 0x0F, 0x30, 0x18, 0x0C, 0x18, 0xE2, 
    0x08, 0x89, 0x84, 0x45, 0x82, 0x3F, 0x00, 0x30, 0x00, 0x0F, 0x70, 0x02, 0x04, 0x01, 0x9C, 0x00, 
    0xF0, 0x00, 0xC0, 0xC0, 0x7F, 0x20, 0x22, 0x10, 0x11, 0x88, 0x08, 0x44, 0x04, 0x22, 0x02, 0xEE, 
    0x00, 0x3E, 0x80, 0x20, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x01, 0xFF, 0x81, 
    0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x10, 0x04, 0xF0, 0x01, 0xFE, 0x03, 0x11, 0x81, 0x88, 
    0x40, 0x44, 0x20, 0x22, 0x10, 0x11, 0x88, 0x08, 0xFC, 0x07, 0x22, 0x00, 0x11, 0x80, 0x08, 0x40, 
    0x04, 0x20, 0x02, 0x10, 0x01, 0xE0, 0x03, 0x08, 0x02, 0x02, 0x02, 0x01, 0x81, 0x80, 0x40, 0x44, 
    0x40, 0x1E, 0xF0, 0x1F, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0xC0, 0x7F, 0x20, 
    0x20, 0x10, 0x10, 0xF8, 0x0F, 0x04, 0x04, 0x02, 0x02, 0x80, 0x00, 0x80, 0x40, 0x40, 0x20, 0x20, 
    0xF0, 0x0F, 0xF8, 0x0F, 0x40, 0x00, 0x30, 0x00, 0x24, 0x00, 0x61, 0x40, 0x40, 0xE0, 0x3F, 0x00, 
    0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0xC0, 0x7F, 0x60, 0x00, 0xC0, 0x01, 
    0x00, 0x01, 0x70, 0x00, 0x06, 0x00, 0xFF, 0x81, 0xFF, 0xC0, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 
    0x03, 0x00, 0x06, 0xFE, 0x03, 0x7C, 0x00, 0x41, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x10, 0x04, 
    0xF0, 0x01, 0xFE, 0x03, 0x21, 0x80, 0x10, 0x40, 0x08, 0x20, 0x04, 0x10, 0x02, 0xF0, 0x00, 0xF0, 
    0x01, 0x04, 0x01, 0x01, 0x81, 0x80, 0x40, 0xC0, 0x40, 0xD0, 0xC0, 0x07, 0xF8, 0x0F, 0x44, 0x00, 
    0x22, 0x00, 0x11, 0x80, 0x18, 0x40, 0x34, 0xC0, 0x21, 0xE0, 0x08, 0x88, 0x08, 0x44, 0x04, 0x22, 
    0x02, 0x11, 0x81, 0x88, 0x80, 0x38, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0xFC, 0x07, 0x02, 0x00, 
    0x01, 0x80, 0x00, 0xC0, 0x3F, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0xFF, 
    0x80, 0x01, 0x80, 0x07, 0x00, 0x1C, 0x00, 0x10, 0x00, 0x07, 0x78, 0x00, 0x06, 0x00, 0x07, 0x00, 
    0xFC, 0x00, 0x30, 0x00, 0x07, 0x00, 0x0C, 0xC0, 0x0F, 0x1C, 0x00, 0x02, 0x02, 0x83, 0x01, 0x36, 
    0x00, 0x04, 0x80, 0x0D, 0x30, 0x18, 0x08, 0x08, 0x04, 0x00, 0x04, 0x00, 0x0C, 0x00, 0xF8, 0x00, 
    0x03, 0x40, 0x00, 0x10, 0x00, 0x08, 0x0C, 0x04, 0x05, 0x42, 0x02, 0x11, 0x81, 0x84, 0x40, 0x41, 
    0x60, 0x20, 0xFC, 0x3F, 0x02, 0x10, 0x01, 0x08, 0x02, 0x00, 0x06, 0x00, 0x1C, 0x00, 0x30, 0x00, 
    0x60, 0x00, 0x40, 0x02, 0x10, 0x01, 0x88, 0xFF, 0x07, 0x08, 0x00, 0x02, 0x80, 0x00, 0x20, 0x00, 
    0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 
    0x80, 0x00, 0x40, 0x00, 0x20, 0x01, 0x00, 0x01, 0x00, 0x60, 0x00, 0x4A, 0x80, 0x24, 0x40, 0x12, 
    0x20, 0x05, 0xE0, 0x87, 0xFF, 0x03, 0x88, 0x00, 0x82, 0x00, 0x41, 0x80, 0x20, 0x80, 0x0F, 0x80, 
    0x03, 0x20, 0x02, 0x08, 0x02, 0x04, 0x01, 0x82, 0x00, 0x22, 0x00, 0x1F, 0x40, 0x10, 0x20, 0x08, 
    0x10, 0x04, 0x10, 0xC1, 0xFF, 0x01, 0x7C, 0x00, 0x49, 0x80, 0x24, 0x40, 0x12, 0x20, 0x09, 0xE0, 
    0x02, 0x08, 0x00, 0x04, 0xC0, 0xFF, 0x10, 0x01, 0x88, 0x00, 0x80, 0x0F, 0x20, 0x28, 0x10, 0x24, 
    0x08, 0x12, 0x84, 0x08, 0xFE, 0xF3, 0x7F, 0x00, 0x01, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0xF0, 
    0x03, 0x04, 0x01, 0x82, 0x10, 0x7F, 0x00, 0x20, 0x00, 0x10, 0x00, 0x40, 0x10, 0x20, 0x08, 0x50, 
    0xFC, 0xE7, 0xFF, 0x00, 0x08, 0x00, 0x06, 0x80, 0x04, 0x20, 0x04, 0x00, 0x84, 0x00, 0x40, 0x00, 
    0xE0, 0x7F, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0xE0, 0x0F, 0x10, 0x00, 0x08, 0x00, 0xFC, 0x01, 
    0x02, 0x00, 0x01, 0x80, 0x3F, 0xC0, 0x1F, 0x40, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0xFC, 
    0x00, 0x3E, 0x80, 0x20, 0x40, 0x10, 0x20, 0x08, 0x10, 0x04, 0xF0, 0x01, 0xFC, 0x0F, 0x44, 0x00, 
    0x41, 0x80, 0x20, 0x40, 0x10, 0xC0, 0x07, 0xE0, 0x03, 0x08, 0x02, 0x04, 0x01, 0x82, 0x00, 0x22, 
    0x80, 0xFF, 0xC1, 0x1F, 0x40, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x4C, 0x00, 0x49, 0x80, 
    0x24, 0x40, 0x12, 0x20, 0x09, 0x20, 0x03, 0x08, 0x00, 0x04, 0x80, 0x7F, 0x00, 0x41, 0x80, 0x20, 
    0x40, 0x10, 0xE0, 0x07, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x40, 0x00, 0x7F, 0x80, 0x01, 0x00, 
    0x07, 0x00, 0x0C, 0xC0, 0x01, 0x18, 0x00, 0x0C, 0x00, 0x38, 0x00, 0x60, 0x00, 0x0E, 0x00, 0x18, 
    0x80, 0x03, 0x30, 0x00, 0x08, 0x02, 0x8C, 0x01, 0x38, 0x00, 0x63, 0x80, 0x20, 0x40, 0x00, 0xC0, 
    0x41, 0x00, 0x33, 0x00, 0x07, 0x70, 0x00, 0x06, 0x00, 0x61, 0x80, 0x28, 0x40, 0x12, 0x20, 0x09, 
    0x50, 0x04, 0x18, 0x02, 0x08, 0x00, 0x04, 0xE0, 0x7D, 0x08, 0x40, 0x04, 0x20, 0xFE, 0x3F, 0x01, 
    0x88, 0x00, 0x84, 0xF7, 0x01, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 
    0x40, 0x00, 0x20, 0x00, 0x08, 0x00, 0x00
};
/* }}} */
/* font ascii bold {{{ */
const __flash uint8_t font_ascii_bold[] = {
    0x04, 0x9A, 0x08, 0x0F, 0x01, 0x21, 0x7E,
    0x02, 0x06, 0x08, 0x07, 0x08, 0x07, 0x02, 0x03, 0x03, 0x07, 0x06, 0x03, 0x04, 0x02, 0x06, 0x07, 
    0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, 0x03, 0x07, 0x07, 0x07, 0x05, 0x08, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
    0x07, 0x08, 0x07, 0x06, 0x07, 0x07, 0x08, 0x07, 0x08, 0x07, 0x04, 0x06, 0x03, 0x07, 0x08, 0x03, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x07, 0x07, 0x06, 0x06, 0x06, 
    0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, 0x06, 0x06, 0x06, 0x01, 0x06, 0x07, 
    0xF8, 0x0D, 0xFC, 0x06, 0x1E, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0xF0, 0x00, 0x00, 
    0x02, 0x20, 0x07, 0xF0, 0x01, 0x5E, 0x00, 0xE4, 0x00, 0x1F, 0xC0, 0x09, 0x80, 0x00, 0x60, 0x04, 
    0x78, 0x06, 0x24, 0x82, 0xFF, 0x07, 0x89, 0x80, 0x7D, 0x00, 0x1C, 0x60, 0x02, 0x48, 0x01, 0xA4, 
    0x00, 0x2C, 0x00, 0xD0, 0x00, 0x98, 0x00, 0x4A, 0x00, 0x19, 0x00, 0x0E, 0xB0, 0x0F, 0x7C, 0x04, 
    0x72, 0x02, 0xE1, 0x01, 0xE0, 0x00, 0x5C, 0xE0, 0x01, 0xF0, 0x00, 0xF0, 0x03, 0xFE, 0x87, 0x01, 
    0xC6, 0x00, 0xC3, 0xFF, 0x80, 0x1F, 0x40, 0x02, 0xE0, 0x01, 0x60, 0x00, 0xFC, 0x00, 0x18, 0x00, 
    0x1E, 0x00, 0x09, 0x00, 0x0C, 0x00, 0x06, 0xC0, 0x0F, 0xE0, 0x07, 0xC0, 0x00, 0x60, 0x00, 0x00, 
    0x04, 0xC0, 0x01, 0x60, 0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x00, 0x00, 0x03, 0x80, 0x01, 
    0x00, 0x02, 0xC0, 0x00, 0x1C, 0x80, 0x03, 0x30, 0x00, 0x04, 0x00, 0xF8, 0x00, 0xFE, 0x80, 0xC1, 
    0x40, 0x46, 0x60, 0x30, 0xE0, 0x0F, 0xE0, 0x03, 0x04, 0x04, 0x02, 0x02, 0xFF, 0x81, 0xFF, 0x00, 
    0x40, 0x00, 0x20, 0x20, 0x10, 0x08, 0x0C, 0x04, 0x07, 0xC2, 0x02, 0x31, 0x81, 0x8F, 0x80, 0x41, 
    0x40, 0x10, 0x10, 0x10, 0x48, 0x08, 0x24, 0x04, 0x32, 0x03, 0xF7, 0x01, 0x7B, 0x00, 0x0C, 0x00, 
    0x07, 0xC0, 0x02, 0x38, 0x01, 0xFC, 0x07, 0xFE, 0x03, 0x20, 0x80, 0x4F, 0xC0, 0x43, 0x20, 0x21, 
    0x90, 0x10, 0xC8, 0x0C, 0xC4, 0x03, 0xE0, 0x01, 0x7C, 0x00, 0x7F, 0xC0, 0x42, 0x20, 0x21, 0x90, 
    0x10, 0xD0, 0x0F, 0xC0, 0x03, 0x02, 0x00, 0x01, 0x81, 0xE0, 0x40, 0x3C, 0xA0, 0x07, 0xF0, 0x00, 
    0x18, 0x00, 0xD8, 0x03, 0xEE, 0x03, 0x09, 0x81, 0x84, 0x40, 0x42, 0xE0, 0x3E, 0x60, 0x0F, 0xF0, 
    0x00, 0xFC, 0x02, 0x42, 0x02, 0x21, 0x81, 0xD0, 0x80, 0x3F, 0x80, 0x0F, 0xC0, 0x18, 0x60, 0x0C, 
    0x00, 0x10, 0x18, 0x07, 0x8C, 0x01, 0x10, 0x00, 0x1C, 0x00, 0x0A, 0x80, 0x0D, 0xC0, 0x06, 0x20, 
    0x02, 0x18, 0x03, 0xD8, 0x00, 0x6C, 0x00, 0x36, 0x00, 0x1B, 0x80, 0x0D, 0xC0, 0x06, 0x60, 0x03, 
    0x18, 0x03, 0x88, 0x00, 0x6C, 0x00, 0x36, 0x00, 0x0A, 0x00, 0x07, 0x00, 0x01, 0x08, 0x00, 0x62, 
    0x03, 0xB9, 0x81, 0x07, 0x80, 0x01, 0x80, 0x1F, 0xE0, 0x1F, 0x18, 0x18, 0xE2, 0x19, 0xF9, 0x89, 
    0x84, 0xC4, 0x7F, 0xC3, 0x3F, 0x00, 0x30, 0x80, 0x1F, 0xF8, 0x03, 0x8C, 0x00, 0xFE, 0x00, 0xF8, 
    0x01, 0xC0, 0xC0, 0x7F, 0xE0, 0x3F, 0x10, 0x11, 0x88, 0x08, 0x44, 0x04, 0xDE, 0x03, 0xEE, 0x00, 
    0x3E, 0x80, 0x3F, 0x60, 0x30, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x01, 0xFF, 0x81, 0xFF, 
    0x40, 0x40, 0x20, 0x20, 0x30, 0x18, 0xF0, 0x07, 0xF0, 0x01, 0xFE, 0x03, 0xFF, 0x81, 0x88, 0x40, 
    0x44, 0x20, 0x22, 0x10, 0x11, 0x08, 0x08, 0xFC, 0x07, 0xFE, 0x03, 0x11, 0x80, 0x08, 0x40, 0x04, 
    0x20, 0x02, 0x10, 0x00, 0xE0, 0x03, 0xF8, 0x03, 0x06, 0x03, 0x01, 0x81, 0x88, 0x40, 0x7C, 0x40, 
    0x3E, 0xF0, 0x1F, 0xF8, 0x0F, 0x40, 0x00, 0x20, 0x00, 0x10, 0x80, 0xFF, 0xC0, 0x7F, 0x20, 0x20, 
    0x10, 0x10, 0xF8, 0x0F, 0xFC, 0x07, 0x02, 0x02, 0x01, 0x01, 0x40, 0x00, 0x40, 0x00, 0x20, 0x10, 
    0x10, 0x08, 0x08, 0xFC, 0x07, 0xFE, 0x01, 0xFF, 0x81, 0xFF, 0x00, 0x06, 0x80, 0x07, 0x60, 0x0F, 
    0x18, 0x0E, 0x04, 0x04, 0xFE, 0x03, 0xFF, 0x01, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 
    0x08, 0xFC, 0x07, 0xFE, 0x03, 0x1F, 0x00, 0x18, 0xC0, 0x07, 0xE0, 0x3F, 0xF0, 0x1F, 0xF8, 0x0F, 
    0xFC, 0x07, 0x1E, 0x00, 0x38, 0x00, 0xF0, 0xC0, 0x7F, 0xE0, 0x3F, 0xC0, 0x07, 0xF0, 0x07, 0x0C, 
    0x06, 0x02, 0x02, 0x83, 0x01, 0x7F, 0x00, 0x1F, 0xE0, 0x3F, 0xF0, 0x1F, 0x08, 0x01, 0x84, 0x00, 
    0x42, 0x00, 0x3F, 0x00, 0x0F, 0x00, 0x1F, 0xC0, 0x1F, 0x30, 0x18, 0x08, 0x08, 0x0C, 0x0E, 0xFC, 
    0x0F, 0x7C, 0x80, 0xFF, 0xC0, 0x7F, 0x20, 0x04, 0x10, 0x02, 0x08, 0x03, 0x7C, 0x03, 0x3C, 0x03, 
    0x00, 0x01, 0x47, 0xC0, 0x47, 0x20, 0x23, 0x10, 0x11, 0x88, 0x09, 0xC4, 0x07, 0xC4, 0x01, 0x01, 
    0x80, 0x00, 0xC0, 0x7F, 0xE0, 0x3F, 0x10, 0x00, 0x08, 0x00, 0xFC, 0x03, 0xFE, 0x03, 0x00, 0x01, 
    0x80, 0x00, 0x40, 0xE0, 0x3F, 0xF0, 0x0F, 0x18, 0x00, 0xFC, 0x00, 0xF0, 0x03, 0x80, 0x01, 0xFC, 
    0xC0, 0x0F, 0x60, 0x00, 0xF0, 0x00, 0xF8, 0x0F, 0x00, 0x07, 0x78, 0x00, 0x3C, 0x00, 0xF0, 0xC0, 
    0x7F, 0xE0, 0x01, 0x10, 0x10, 0x38, 0x0E, 0xB8, 0x03, 0x70, 0x00, 0xEE, 0x80, 0xE3, 0x40, 0x40, 
    0x20, 0x00, 0x70, 0x00, 0xF0, 0x00, 0xE0, 0x07, 0xF0, 0x03, 0x1E, 0x80, 0x03, 0x40, 0x00, 0x20, 
    0x30, 0x10, 0x1C, 0x88, 0x0B, 0xE4, 0x04, 0x3A, 0x02, 0x07, 0x81, 0x81, 0xF0, 0xFF, 0xF8, 0x7F, 
    0x04, 0x20, 0x02, 0x10, 0x04, 0x00, 0x1E, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0x80, 0x04, 
    0x20, 0xFE, 0x1F, 0xFF, 0x0F, 0x10, 0x00, 0x0C, 0x80, 0x03, 0xC0, 0x00, 0xE0, 0x00, 0xC0, 0x00, 
    0x40, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 
    0x40, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x60, 0x00, 0x7A, 0x80, 0x24, 0x40, 0x12, 0xE0, 0x0F, 
    0xE0, 0x87, 0xFF, 0xC3, 0xFF, 0x01, 0x82, 0x00, 0x41, 0x80, 0x3F, 0x80, 0x0F, 0x80, 0x03, 0xE0, 
    0x03, 0x18, 0x03, 0x04, 0x01, 0x82, 0x00, 0x22, 0x00, 0x1F, 0xC0, 0x1F, 0x20, 0x08, 0x10, 0x84, 
    0xFF, 0xC3, 0xFF, 0x01, 0x7C, 0x00, 0x7F, 0x80, 0x24, 0x40, 0x12, 0xE0, 0x09, 0xE0, 0x02, 0x08, 
    0x00, 0x04, 0xC0, 0xFF, 0xF0, 0x7F, 0x88, 0x00, 0x44, 0x00, 0xC0, 0x07, 0xF0, 0x27, 0x08, 0x12, 
    0x04, 0x09, 0xFE, 0x07, 0xFF, 0xF9, 0x3F, 0xFC, 0x1F, 0x20, 0x00, 0x10, 0x00, 0xF8, 0x03, 0xF8, 
    0x01, 0x82, 0x00, 0x41, 0x98, 0x3F, 0xCC, 0x1F, 0x00, 0x08, 0x00, 0x04, 0x00, 0x10, 0x04, 0x08, 
    0x02, 0x34, 0xFF, 0x9B, 0xFF, 0xFC, 0x1F, 0xFE, 0x0F, 0xC0, 0x00, 0xF0, 0x01, 0xCC, 0x01, 0x80, 
    0x10, 0x00, 0x08, 0x00, 0xFC, 0x0F, 0xFE, 0x0F, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0xFE, 0x00, 
    0x7F, 0x80, 0x00, 0xC0, 0x1F, 0x20, 0x00, 0xF0, 0x07, 0xF8, 0x03, 0xFC, 0x01, 0xFE, 0x00, 0x01, 
    0x80, 0x00, 0xC0, 0x1F, 0xC0, 0x0F, 0xE0, 0x03, 0xF8, 0x03, 0x04, 0x01, 0x82, 0x00, 0x7F, 0x00, 
    0x1F, 0xC0, 0xFF, 0xE0, 0x7F, 0x10, 0x04, 0x08, 0x02, 0xFC, 0x01, 0x7C, 0x00, 0x3E, 0x80, 0x3F, 
    0x40, 0x10, 0x20, 0x08, 0xF0, 0x3F, 0xF8, 0x1F, 0xFC, 0x01, 0xFE, 0x00, 0x01, 0x80, 0x00, 0x40, 
    0x00, 0xC0, 0x04, 0xF0, 0x04, 0x68, 0x02, 0x24, 0x01, 0xF2, 0x00, 0x32, 0x80, 0x00, 0x40, 0x00, 
    0xF8, 0x07, 0xFC, 0x07, 0x08, 0x02, 0x04, 0x01, 0x7E, 0x00, 0x7F, 0x00, 0x20, 0x00, 0x10, 0xE0, 
    0x0F, 0xF0, 0x07, 0x18, 0x00, 0x7C, 0x00, 0xF0, 0x00, 0x78, 0x80, 0x0F, 0xC0, 0x00, 0xE0, 0x00, 
    0xF0, 0x07, 0x00, 0x03, 0x70, 0x00, 0x38, 0x00, 0x60, 0x80, 0x3F, 0xC0, 0x01, 0x20, 0x08, 0x30, 
    0x07, 0xF0, 0x01, 0xF8, 0x00, 0xE6, 0x00, 0x41, 0x80, 0x01, 0xC1, 0xC7, 0x00, 0x7F, 0xC0, 0x0F, 
    0xF8, 0x00, 0x0C, 0x00, 0xC2, 0x00, 0x71, 0x80, 0x2C, 0x40, 0x13, 0xE0, 0x08, 0x30, 0x04, 0x20, 
    0x00, 0x10, 0xC0, 0xF7, 0xF0, 0xFB, 0x08, 0x40, 0x04, 0x20, 0xFE, 0x3F, 0x01, 0x88, 0x00, 0xC4, 
    0xEF, 0xC3, 0xF7, 0x01, 0x04, 0x00, 0x02, 0x00, 0x02, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x20, 
    0x00, 0x10, 0x00, 0x04, 0x00
};
/* }}} */
/* font latin1 {{{ */
const __flash uint8_t font_latin1[] = {
    0x04, 0x8A, 0x08, 0x0F, 0x01, 0x20, 0x7F,
    0x08, 0x01, 0x05, 0x06, 0x06, 0x07, 0x01, 0x05, 0x03, 0x07, 0x05, 0x06, 0x07, 0x03, 0x07, 0x04, 
    0x04, 0x07, 0x04, 0x04, 0x02, 0x07, 0x07, 0x02, 0x03, 0x03, 0x05, 0x06, 0x07, 0x07, 0x07, 0x05, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x05, 0x05, 0x05, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
    
    0x3E, 0x00, 0x02, 0x00, 0x92, 0xC0, 0x57, 0x00, 0xEA, 0x03, 0x59, 0x00, 0x28, 0x00, 0x08, 0xD8, 
    0x0F, 0xE0, 0x03, 0x08, 0x02, 0xFF, 0x07, 0x82, 0x00, 0x22, 0x00, 0x20, 0x00, 0x11, 0xF0, 0x0F, 
    0x44, 0x04, 0x22, 0x02, 0x01, 0x01, 0x42, 0x00, 0x1E, 0x00, 0x09, 0x80, 0x04, 0xC0, 0x03, 0x10, 
    0x02, 0x52, 0x00, 0x2A, 0x00, 0x16, 0x00, 0x7C, 0x80, 0x05, 0xA0, 0x02, 0x48, 0x01, 0x3E, 0x1F, 
    0x7C, 0x04, 0x65, 0x82, 0x24, 0x41, 0xA6, 0x20, 0x3E, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x78, 
    0x00, 0x42, 0x80, 0x5E, 0x40, 0x29, 0xA0, 0x14, 0x20, 0x04, 0xE0, 0x01, 0x64, 0x01, 0xAA, 0x00, 
    0x55, 0x80, 0x2A, 0x80, 0x17, 0x00, 0x06, 0x80, 0x07, 0x60, 0x06, 0xC0, 0x00, 0xF0, 0x00, 0xCC, 
    0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x00, 0x20, 0x00, 
    0x10, 0x00, 0x08, 0x80, 0x07, 0x20, 0x04, 0xE8, 0x05, 0x54, 0x02, 0x5A, 0x01, 0x42, 0x00, 0x1E, 
    0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x18, 0x00, 0x12, 0x00, 0x09, 0x00, 0x03, 0x00, 
    0x44, 0x00, 0x22, 0x00, 0x11, 0xE0, 0x0B, 0x40, 0x04, 0x20, 0x02, 0x10, 0x81, 0x08, 0x40, 0x06, 
    0xA0, 0x02, 0x30, 0x01, 0x88, 0x00, 0x54, 0x00, 0x2A, 0x00, 0x1B, 0x80, 0x00, 0x20, 0x00, 0x80, 
    0xFF, 0x01, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x01, 0xFC, 0x01, 0x80, 0x80, 0x03, 0xE0, 0x01, 
    0xF0, 0x01, 0xF8, 0x00, 0xFC, 0x0F, 0x02, 0x00, 0xFF, 0x03, 0x18, 0x00, 0x0C, 0x00, 0x00, 0x01, 
    0x80, 0x00, 0x70, 0x44, 0x00, 0x3E, 0x00, 0x10, 0x00, 0x27, 0x40, 0x14, 0x20, 0x0A, 0x10, 0x05, 
    0x70, 0x02, 0x30, 0x03, 0xF0, 0x00, 0x30, 0x00, 0x66, 0x00, 0x1E, 0x00, 0x06, 0x00, 0x02, 0x44, 
    0x01, 0x7E, 0x00, 0x30, 0x06, 0x90, 0x02, 0xE4, 0x03, 0x82, 0x00, 0x04, 0x88, 0x02, 0xFC, 0x00, 
    0x60, 0x11, 0xA0, 0x0C, 0x48, 0x05, 0x44, 0x02, 0x08, 0x10, 0x05, 0xA8, 0x01, 0xD4, 0x18, 0x76, 
    0x0A, 0x90, 0x0F, 0x08, 0x02, 0x60, 0x00, 0x48, 0x60, 0x23, 0x00, 0x10, 0x00, 0x04, 0x00, 0x06, 
    0xE0, 0x21, 0x4E, 0xA0, 0x20, 0x80, 0x13, 0x00, 0x1E, 0x00, 0x18, 0x00, 0x0C, 0xC0, 0x03, 0x9C, 
    0x40, 0x41, 0x10, 0x27, 0x00, 0x3C, 0x00, 0x30, 0x00, 0x18, 0x80, 0x07, 0x39, 0x41, 0x82, 0x40, 
    0x4E, 0x00, 0x78, 0x00, 0x60, 0x00, 0x30, 0x06, 0x0F, 0x71, 0x82, 0x05, 0x81, 0x9C, 0x60, 0xF0, 
    0x00, 0xC0, 0x00, 0x60, 0x00, 0x1E, 0xE4, 0x04, 0x08, 0x02, 0x39, 0x01, 0xE0, 0x01, 0x80, 0x01, 
    0xC0, 0x00, 0x3C, 0xDC, 0x09, 0x1A, 0x04, 0x77, 0x02, 0xC0, 0x03, 0x00, 0x03, 0x80, 0x01, 0x38, 
    0xC0, 0x13, 0x20, 0x08, 0xF0, 0x1F, 0x88, 0x08, 0x44, 0x04, 0xF8, 0x00, 0x82, 0x80, 0x80, 0x44, 
    0x40, 0x22, 0xE0, 0x11, 0x10, 0x10, 0x04, 0xFC, 0x07, 0x22, 0x22, 0x11, 0xA1, 0x88, 0x40, 0x44, 
    0x20, 0x22, 0x10, 0x11, 0xF8, 0x0F, 0x44, 0x84, 0x22, 0x22, 0x11, 0x81, 0x88, 0x40, 0x44, 0x20, 
    0x22, 0xF0, 0x1F, 0x8A, 0x88, 0x44, 0x44, 0x22, 0x42, 0x11, 0x81, 0x88, 0x40, 0x44, 0xE0, 0x3F, 
    0x10, 0x11, 0x8A, 0x08, 0x44, 0x84, 0x22, 0x02, 0x11, 0x81, 0x88, 0x40, 0x40, 0x24, 0x20, 0xF4, 
    0x1F, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0xA1, 0xFF, 0x48, 0x40, 0x20, 0x20, 0x10, 0x10, 
    0x0A, 0x88, 0xFC, 0x87, 0x02, 0x02, 0x01, 0x81, 0x80, 0x50, 0x40, 0xE0, 0x3F, 0x14, 0x10, 0x08, 
    0x08, 0x40, 0x00, 0xFE, 0x03, 0x11, 0x81, 0x88, 0x40, 0x40, 0x40, 0x10, 0xC0, 0x07, 0xF8, 0x8F, 
    0x0D, 0x40, 0x18, 0x60, 0x10, 0x20, 0x30, 0x18, 0x60, 0xE0, 0x3F, 0xC0, 0x07, 0x10, 0x84, 0x04, 
    0x84, 0x02, 0x02, 0x01, 0x01, 0x41, 0x00, 0x1F, 0x80, 0x0F, 0x20, 0x08, 0x08, 0x08, 0x05, 0x44, 
    0x02, 0x02, 0x82, 0x00, 0x3E, 0x00, 0x1F, 0x40, 0x10, 0x14, 0x10, 0x09, 0x08, 0x05, 0x04, 0x04, 
    0x01, 0x7C, 0x00, 0x3E, 0x98, 0x20, 0x24, 0x20, 0x16, 0x10, 0x0A, 0x88, 0x09, 0x02, 0xF8, 0x00, 
    0x7C, 0x00, 0x41, 0x50, 0x40, 0x20, 0x20, 0x14, 0x10, 0x10, 0x04, 0xF0, 0x01, 0x08, 0x01, 0x48, 
    0x00, 0x18, 0x00, 0x0C, 0x00, 0x09, 0x40, 0x08, 0xE0, 0x13, 0x08, 0x06, 0xC2, 0x02, 0x11, 0x81, 
    0x86, 0xC0, 0x20, 0x90, 0x0F, 0xF0, 0x0F, 0x00, 0x88, 0x00, 0x84, 0x00, 0x02, 0x00, 0x01, 0x80, 
    0xC0, 0x3F, 0xE0, 0x1F, 0x00, 0x10, 0x00, 0x08, 0x01, 0x44, 0x00, 0x02, 0x00, 0x81, 0x7F, 0xC0, 
    0x3F, 0x00, 0x20, 0x04, 0x10, 0x01, 0x08, 0x01, 0x04, 0x00, 0x02, 0xFF, 0x80, 0x7F, 0x00, 0x40, 
    0x08, 0x20, 0x00, 0x10, 0x02, 0x08, 0x00, 0x04, 0xFE, 0x01, 0x01, 0x00, 0x01, 0x00, 0x03, 0x08, 
    0x3E, 0xC2, 0x00, 0x10, 0x00, 0x04, 0x00, 0xFE, 0x03, 0x22, 0x00, 0x11, 0x80, 0x08, 0x40, 0x04, 
    0x60, 0x03, 0xE0, 0x00, 0xFE, 0x87, 0x00, 0x40, 0x1C, 0x21, 0x89, 0x60, 0x4C, 0x00, 0x1C, 0x00, 
    0x0C, 0x40, 0x09, 0x92, 0x04, 0x4A, 0x02, 0xA4, 0x00, 0xFC, 0x00, 0x30, 0x00, 0x25, 0x50, 0x12, 
    0x24, 0x09, 0x90, 0x02, 0xF0, 0x03, 0xC0, 0x80, 0x94, 0x20, 0x49, 0x90, 0x24, 0x50, 0x0A, 0xC0, 
    0x0F, 0x00, 0x03, 0x53, 0x82, 0x24, 0x81, 0x92, 0x60, 0x29, 0x00, 0x3F, 0x00, 0x0C, 0x40, 0x09, 
    0x92, 0x04, 0x48, 0x82, 0xA4, 0x00, 0xFC, 0x00, 0x30, 0x18, 0x25, 0x52, 0x12, 0x29, 0x09, 0x93, 
    0x02, 0xF0, 0x03, 0xE4, 0x01, 0x92, 0x00, 0x3E, 0x80, 0x24, 0x40, 0x12, 0xC0, 0x09, 0xC0, 0x01, 
    0x10, 0x01, 0x04, 0x09, 0x82, 0x04, 0xC1, 0x03, 0x11, 0x80, 0x0F, 0x20, 0x09, 0x92, 0x04, 0x4A, 
    0x02, 0x24, 0x01, 0x5C, 0x00, 0x3E, 0x80, 0x24, 0x50, 0x12, 0x24, 0x09, 0x90, 0x04, 0x70, 0x01, 
    0xF8, 0x80, 0x92, 0x20, 0x49, 0x90, 0x24, 0x50, 0x12, 0xC0, 0x05, 0xE0, 0x03, 0x49, 0x02, 0x24, 
    0x01, 0x92, 0x20, 0x49, 0x00, 0x17, 0x40, 0x10, 0x20, 0x08, 0xF2, 0x07, 0x02, 0x02, 0x00, 0x01, 
    0x82, 0x00, 0x41, 0xA0, 0x3F, 0x08, 0x10, 0x00, 0x08, 0x14, 0x04, 0x09, 0x82, 0xFC, 0x81, 0x80, 
    0x00, 0x40, 0x80, 0x20, 0x48, 0x10, 0xE0, 0x0F, 0x02, 0x04, 0x00, 0x02, 0xF8, 0xA0, 0x82, 0x20, 
    0x41, 0xA8, 0x20, 0x60, 0x10, 0xC0, 0x07, 0xF0, 0x07, 0x13, 0x80, 0x04, 0x80, 0x02, 0x60, 0x01, 
    0x00, 0x3F, 0x80, 0x0F, 0x20, 0x08, 0x12, 0x04, 0x0A, 0x02, 0x04, 0x01, 0x7C, 0x00, 0x3E, 0x80, 
    0x20, 0x50, 0x10, 0x24, 0x08, 0x10, 0x04, 0xF0, 0x01, 0xF8, 0x80, 0x82, 0x20, 0x41, 0x90, 0x20, 
    0x50, 0x10, 0xC0, 0x07, 0xE0, 0x03, 0x0B, 0x82, 0x04, 0x81, 0x82, 0x60, 0x41, 0x00, 0x1F, 0x80, 
    0x0F, 0x24, 0x08, 0x10, 0x04, 0x08, 0x82, 0x04, 0x01, 0x7C, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 
    0xB0, 0x06, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x7C, 0x01, 0x61, 0x80, 0x2C, 0x40, 0x11, 0x60, 
    0x08, 0xE8, 0x03, 0xF8, 0x01, 0x00, 0x41, 0x80, 0x40, 0x40, 0x00, 0x10, 0xC0, 0x1F, 0xE0, 0x07, 
    0x00, 0x04, 0x02, 0x82, 0x00, 0x01, 0x40, 0x00, 0x7F, 0x80, 0x1F, 0x10, 0x10, 0x04, 0x08, 0x02, 
    0x04, 0x02, 0x01, 0xFC, 0x01, 0x7E, 0x20, 0x40, 0x00, 0x20, 0x00, 0x10, 0x04, 0x04, 0xF0, 0x07, 
    0x18, 0x00, 0x30, 0x88, 0x20, 0x22, 0xE0, 0x00, 0x0E, 0xC0, 0x00, 0xFE, 0x7F, 0x20, 0x02, 0x08, 
    0x02, 0x04, 0x01, 0x82, 0x00, 0x3E, 0x80, 0x01, 0x08, 0x83, 0x00, 0x22, 0x02, 0x0E, 0xE0, 0x00, 
    0x0C, 0x00, 0x00
};
/* }}} */
/* font latin1 bold {{{ */
const __flash uint8_t font_latin1_bold[] = {
    0x04, 0xAE, 0x08, 0x0F, 0x01, 0x20, 0x7F,
    0x08, 0x02, 0x06, 0x06, 0x04, 0x08, 0x01, 0x06, 0x05, 0x08, 0x05, 0x06, 0x07, 0x04, 0x08, 0x04, 
    0x04, 0x06, 0x04, 0x04, 0x03, 0x07, 0x06, 0x02, 0x03, 0x03, 0x05, 0x06, 0x07, 0x07, 0x07, 0x05, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 
    0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x08, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x06, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
    0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
    
    0x3E, 0x00, 0x02, 0x00, 0x92, 0xC0, 0x57, 0x00, 0xEA, 0x03, 0x59, 0x00, 0x28, 0x00, 0x08, 0xD8, 
    0x0F, 0xEC, 0x07, 0xF0, 0x00, 0xFC, 0x01, 0x82, 0xC0, 0xFF, 0x81, 0x20, 0x80, 0x08, 0x80, 0x08, 
    0xF8, 0x07, 0xFE, 0x03, 0x11, 0x81, 0x88, 0x80, 0x40, 0x00, 0x0F, 0x80, 0x04, 0x40, 0x02, 0xE0, 
    0x01, 0x52, 0x00, 0x2F, 0x00, 0x17, 0x00, 0x7E, 0x00, 0x3F, 0xE0, 0x02, 0x78, 0x01, 0xA4, 0x00, 
    0x3E, 0x1F, 0x32, 0x80, 0x3F, 0x41, 0x93, 0x20, 0x5B, 0x90, 0x3F, 0x80, 0x09, 0x06, 0x00, 0x03, 
    0x00, 0x00, 0xC0, 0x00, 0x60, 0x00, 0x80, 0x07, 0x20, 0x04, 0xC8, 0x04, 0x94, 0x02, 0x4A, 0x01, 
    0xA5, 0x00, 0x21, 0x00, 0x0F, 0x80, 0x03, 0x50, 0x05, 0xA8, 0x02, 0x54, 0x01, 0xBC, 0x00, 0x30, 
    0x00, 0x3C, 0x00, 0x33, 0x00, 0x06, 0x80, 0x07, 0x60, 0x06, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 
    0x0C, 0x00, 0x06, 0x00, 0x07, 0x80, 0x03, 0x80, 0x01, 0xC0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x1E, 
    0x80, 0x10, 0xA0, 0x17, 0x50, 0x09, 0xA8, 0x04, 0xB4, 0x02, 0x84, 0x00, 0x3C, 0x40, 0x00, 0x20, 
    0x00, 0x10, 0x00, 0x08, 0x00, 0x30, 0x00, 0x24, 0x00, 0x12, 0x00, 0x06, 0x00, 0xCC, 0x00, 0x66, 
    0xC0, 0x3F, 0xE0, 0x1F, 0xC0, 0x0C, 0x60, 0x06, 0x11, 0x80, 0x0C, 0x40, 0x05, 0x60, 0x02, 0x10, 
    0x01, 0xA8, 0x00, 0x54, 0x00, 0x36, 0x00, 0x02, 0x80, 0x01, 0x40, 0x00, 0x00, 0xFF, 0x83, 0xFF, 
    0x01, 0x10, 0x00, 0x08, 0xF0, 0x03, 0xF8, 0x03, 0x00, 0x01, 0x07, 0xC0, 0x07, 0xE0, 0x03, 0xF0, 
    0x3F, 0x08, 0x00, 0xFC, 0x0F, 0x30, 0x00, 0x18, 0x00, 0x00, 0x04, 0x80, 0x02, 0x80, 0x89, 0x00, 
    0x7C, 0x00, 0x20, 0x00, 0x9C, 0x00, 0x51, 0x80, 0x28, 0x40, 0x14, 0xC0, 0x09, 0xC0, 0x0C, 0xC0, 
    0x03, 0xC0, 0x00, 0x98, 0x01, 0x78, 0x00, 0x18, 0x10, 0x09, 0xF8, 0x04, 0x40, 0x19, 0x80, 0x0E, 
    0xC0, 0x05, 0xD0, 0x07, 0x08, 0x21, 0x12, 0xF0, 0x09, 0x80, 0x02, 0x00, 0x23, 0x80, 0x19, 0xA0, 
    0x0A, 0xD0, 0x04, 0x20, 0x20, 0x12, 0x50, 0x65, 0xA8, 0x3A, 0x6C, 0x17, 0x40, 0x1F, 0x20, 0x04, 
    0x80, 0x01, 0xE0, 0x81, 0x9D, 0xC0, 0x46, 0x00, 0x10, 0x00, 0x18, 0xC1, 0x8F, 0xFD, 0x81, 0x46, 
    0x00, 0x7F, 0x00, 0xFC, 0x00, 0x60, 0x00, 0x30, 0x80, 0x1F, 0xFA, 0x83, 0x8D, 0x40, 0xFE, 0x00, 
    0xF8, 0x01, 0xC0, 0x00, 0x60, 0x08, 0x3F, 0xF6, 0x07, 0x19, 0x81, 0xFD, 0x81, 0xF0, 0x03, 0x80, 
    0x01, 0xC0, 0x18, 0x7E, 0xE4, 0x0F, 0x36, 0x02, 0xFA, 0x83, 0xE1, 0x07, 0x00, 0x03, 0x80, 0x31, 
    0xFC, 0xD8, 0x1F, 0x60, 0x04, 0xF6, 0x07, 0xC3, 0x0F, 0x00, 0x06, 0x00, 0x03, 0xF0, 0x71, 0x3F, 
    0xE8, 0x09, 0xDC, 0x0F, 0x00, 0x1F, 0x00, 0x0C, 0x00, 0x07, 0xFC, 0x03, 0x33, 0x80, 0xFF, 0xC0, 
    0x7F, 0x20, 0x22, 0x10, 0x11, 0xE0, 0x03, 0xF8, 0x03, 0x06, 0x13, 0x01, 0x8B, 0x80, 0x46, 0x40, 
    0x40, 0x10, 0xF0, 0x1F, 0xF9, 0x8F, 0x45, 0x84, 0x22, 0x02, 0x11, 0x81, 0x88, 0x40, 0x40, 0xE0, 
    0x3F, 0xF0, 0x1F, 0x8A, 0x88, 0x45, 0x44, 0x22, 0x02, 0x11, 0x81, 0x80, 0xC0, 0x7F, 0xE8, 0x3F, 
    0x16, 0x11, 0x89, 0x88, 0x45, 0x84, 0x22, 0x02, 0x01, 0x81, 0xFF, 0xD8, 0x7F, 0x2C, 0x22, 0x10, 
    0x11, 0x8B, 0x88, 0x45, 0x04, 0x02, 0x02, 0x01, 0x91, 0x80, 0xD8, 0x7F, 0xE8, 0x3F, 0x10, 0x10, 
    0x08, 0x08, 0x04, 0x04, 0x02, 0x42, 0xFF, 0xB1, 0xFF, 0x48, 0x40, 0x20, 0x20, 0x10, 0x10, 0x0A, 
    0x88, 0xFC, 0x47, 0xFE, 0x43, 0x01, 0x81, 0x80, 0x58, 0x40, 0x2C, 0x20, 0xF0, 0x1F, 0xF8, 0x8F, 
    0x05, 0xC4, 0x02, 0x02, 0x08, 0x80, 0xFF, 0xC0, 0x7F, 0x20, 0x21, 0x90, 0x10, 0x18, 0x0C, 0xF8, 
    0x03, 0xF8, 0x00, 0xFF, 0xB1, 0xFF, 0xC8, 0x03, 0x0C, 0x07, 0x04, 0x1E, 0xFB, 0x0F, 0xFC, 0x07, 
    0xF8, 0x20, 0xFE, 0xB0, 0xC1, 0x50, 0x40, 0x60, 0x30, 0xE0, 0x0F, 0xE0, 0x03, 0xF0, 0x01, 0xFC, 
    0x41, 0x83, 0xB1, 0x80, 0xC8, 0x60, 0xC0, 0x1F, 0xC0, 0x07, 0xE0, 0x03, 0xF9, 0xC3, 0x06, 0x23, 
    0x01, 0xB1, 0xC1, 0x90, 0x3F, 0x80, 0x0F, 0xC0, 0x07, 0xF3, 0x87, 0x0C, 0xC6, 0x02, 0x42, 0x83, 
    0x31, 0x7F, 0x00, 0x1F, 0x80, 0x0F, 0xE6, 0x0F, 0x1B, 0x0C, 0x04, 0xC4, 0x06, 0x63, 0xFE, 0x00, 
    0x3E, 0x00, 0x12, 0x80, 0x1F, 0x80, 0x07, 0xC0, 0x03, 0xF0, 0x03, 0x90, 0x00, 0x00, 0x01, 0xFE, 
    0x80, 0x7F, 0x60, 0x3C, 0x90, 0x13, 0x78, 0x0C, 0xFC, 0x03, 0xFE, 0x00, 0xFF, 0x90, 0xFF, 0x18, 
    0x40, 0x08, 0x20, 0x00, 0x10, 0xF8, 0x0F, 0xFC, 0x03, 0xFE, 0x01, 0xFF, 0x21, 0x80, 0x18, 0x40, 
    0x04, 0x20, 0xF0, 0x1F, 0xF8, 0x07, 0xFC, 0x83, 0xFE, 0x63, 0x00, 0x11, 0x80, 0x18, 0x40, 0xE8, 
    0x3F, 0xF0, 0x0F, 0xF8, 0x87, 0xFD, 0xC7, 0x00, 0x02, 0x00, 0x31, 0x80, 0xD8, 0x7F, 0xE0, 0x1F, 
    0x10, 0x00, 0x38, 0x00, 0x78, 0x80, 0xF0, 0x63, 0xF8, 0x11, 0x0F, 0xC0, 0x01, 0x20, 0x00, 0xF0, 
    0x1F, 0xF8, 0x0F, 0x10, 0x02, 0x08, 0x01, 0x84, 0x00, 0x7E, 0x00, 0x1E, 0xF0, 0x3F, 0xFC, 0x1F, 
    0x02, 0x00, 0x79, 0x84, 0xFE, 0x83, 0xE1, 0x00, 0x60, 0x20, 0x7A, 0xB0, 0x24, 0x50, 0x12, 0xE0, 
    0x0F, 0xE0, 0x07, 0x80, 0x01, 0xE8, 0x81, 0x92, 0x60, 0x49, 0x90, 0x3F, 0x80, 0x1F, 0x00, 0x06, 
    0xA4, 0x07, 0x4B, 0x82, 0x24, 0xC1, 0xFE, 0x40, 0x7E, 0x00, 0x18, 0x98, 0x1E, 0x24, 0x09, 0x94, 
    0x04, 0xFB, 0x03, 0xF8, 0x01, 0x60, 0x60, 0x7A, 0xB0, 0x24, 0x40, 0x12, 0xEC, 0x0F, 0xE6, 0x07, 
    0x80, 0xC1, 0xE8, 0x91, 0x92, 0x48, 0x49, 0x98, 0x3F, 0x80, 0x1F, 0x00, 0x06, 0xA0, 0x07, 0x48, 
    0x02, 0xFC, 0x01, 0xFE, 0x00, 0x49, 0x00, 0x27, 0x00, 0x07, 0xC0, 0x47, 0x30, 0x2E, 0x08, 0x1A, 
    0x04, 0x01, 0x44, 0x00, 0x3E, 0x90, 0x3F, 0x58, 0x12, 0x28, 0x09, 0xF0, 0x04, 0x70, 0x01, 0xF8, 
    0x00, 0xFE, 0x40, 0x49, 0xB0, 0x24, 0xC8, 0x13, 0xC0, 0x05, 0xE0, 0x03, 0xFA, 0x83, 0x25, 0x41, 
    0x92, 0x60, 0x4F, 0x20, 0x17, 0x80, 0x0F, 0xEC, 0x0F, 0x96, 0x04, 0x48, 0x82, 0x3D, 0xC1, 0x5C, 
    0x00, 0x41, 0x90, 0x20, 0xD8, 0x1F, 0xE8, 0x0F, 0x00, 0x04, 0x00, 0x02, 0x04, 0x01, 0x82, 0x40, 
    0x7F, 0xB0, 0x3F, 0x08, 0x10, 0x00, 0x08, 0x10, 0x04, 0x0A, 0x82, 0xFD, 0x41, 0xFE, 0x60, 0x40, 
    0x20, 0x20, 0x40, 0x10, 0x2C, 0x08, 0xF6, 0x07, 0xF8, 0x83, 0x01, 0xC1, 0x80, 0x00, 0x3E, 0xA8, 
    0x3F, 0x5C, 0x10, 0x3C, 0x08, 0xF9, 0x07, 0xF0, 0x01, 0xFC, 0xC1, 0xFE, 0x20, 0x01, 0xA0, 0x00, 
    0xD8, 0x1F, 0xC0, 0x0F, 0xE0, 0x03, 0xF9, 0x83, 0x05, 0x81, 0x82, 0x00, 0x7F, 0x00, 0x1F, 0x80, 
    0x0F, 0xE0, 0x0F, 0x14, 0x04, 0x0B, 0x82, 0xFC, 0x01, 0x7C, 0x00, 0x3E, 0xA0, 0x3F, 0x48, 0x10, 
    0x24, 0x08, 0xF4, 0x07, 0xF0, 0x01, 0xF8, 0xC0, 0xFE, 0x20, 0x41, 0xA0, 0x20, 0xD8, 0x1F, 0xC0, 
    0x07, 0xE6, 0x03, 0xFB, 0x03, 0x04, 0x01, 0x82, 0x60, 0x7F, 0x30, 0x1F, 0x00, 0x03, 0x80, 0x01, 
    0xC0, 0x00, 0x6C, 0x03, 0xB6, 0x01, 0x18, 0x00, 0x0C, 0x00, 0x06, 0x80, 0x3F, 0xE0, 0x0F, 0x90, 
    0x05, 0x78, 0x02, 0xFC, 0x01, 0x7F, 0x00, 0x3F, 0x90, 0x3F, 0x18, 0x10, 0x08, 0x08, 0xF0, 0x07, 
    0xF8, 0x03, 0xFC, 0x00, 0xFE, 0x40, 0x40, 0x30, 0x20, 0xC8, 0x1F, 0xE0, 0x0F, 0xF0, 0x03, 0xFA, 
    0x83, 0x00, 0x41, 0x80, 0x40, 0x7F, 0x80, 0x3F, 0xD8, 0x0F, 0xEC, 0x0F, 0x00, 0x04, 0x00, 0x82, 
    0xFD, 0xC1, 0xFE, 0x00, 0x03, 0x82, 0x8F, 0x11, 0xFE, 0x8C, 0x1F, 0xF2, 0x01, 0x18, 0xC0, 0xFF, 
    0xEF, 0xFF, 0x07, 0x41, 0x80, 0x20, 0xC0, 0x1F, 0xC0, 0x07, 0x36, 0x20, 0xFB, 0x18, 0xE0, 0xCF, 
    0xF8, 0x61, 0x1F, 0x80, 0x01, 0x00, 0x00
};
/* }}} */
/* font graphic {{{ */
const __flash uint8_t font_graphic[] = {
    0x04, 0xCA, 0x08, 0x0F, 0x01, 0x21, 0x7E,
    0x01, 0x03, 0x08, 0x07, 0x07, 0x07, 0x01, 0x03, 0x03, 0x07, 0x07, 0x03, 0x03, 0x02, 0x06, 0x07, 
    0x05, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, 0x03, 0x07, 0x07, 0x07, 0x05, 0x07, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x05, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 
    0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x06, 0x03, 0x07, 0x00, 0x06, 
    0x08, 0x08, 0x07, 0x08, 0x08, 0x04, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
    0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x06, 0x04, 
    0xF8, 0x0D, 0x3C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x20, 0x00, 0x72, 0x00, 0x0F, 0xE0, 0x04, 0x40, 
    0x0E, 0xE0, 0x01, 0x9C, 0x00, 0x08, 0x00, 0x46, 0x80, 0x44, 0x40, 0x22, 0xF0, 0x7F, 0x10, 0x09, 
    0x88, 0x04, 0x88, 0x01, 0x06, 0x80, 0x14, 0x40, 0x0A, 0xC0, 0x1A, 0x00, 0x13, 0x40, 0x09, 0x20, 
    0x03, 0xE0, 0x01, 0x8E, 0x81, 0x84, 0x40, 0x4C, 0x20, 0x2C, 0x00, 0x08, 0x80, 0x0B, 0x3C, 0x00, 
    0xFC, 0x80, 0x81, 0x21, 0x00, 0x11, 0x80, 0x30, 0x30, 0xE0, 0x07, 0x90, 0x00, 0x50, 0x00, 0x18, 
    0x00, 0x3F, 0x00, 0x06, 0x00, 0x05, 0x40, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xFC, 0x01, 
    0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x80, 0x00, 0x38, 0x00, 0x0C, 0x40, 0x00, 0x20, 0x00, 0x10, 
    0x00, 0xC0, 0x00, 0x60, 0x00, 0x80, 0x00, 0x30, 0x00, 0x06, 0xE0, 0x00, 0x0C, 0x00, 0x01, 0x00, 
    0x3E, 0x80, 0x20, 0x20, 0x20, 0x10, 0x11, 0x08, 0x08, 0x08, 0x02, 0xF8, 0x00, 0x01, 0x81, 0x80, 
    0xC0, 0x7F, 0x00, 0x20, 0x00, 0x10, 0x10, 0x0C, 0x04, 0x05, 0x42, 0x02, 0x21, 0x81, 0x88, 0x40, 
    0x44, 0xC0, 0x21, 0x20, 0x08, 0x08, 0x08, 0x44, 0x04, 0x22, 0x02, 0x11, 0x81, 0x94, 0x80, 0x3B, 
    0x00, 0x0C, 0x00, 0x05, 0x40, 0x02, 0x18, 0x01, 0x82, 0x00, 0xFF, 0x01, 0x20, 0xC0, 0x23, 0x20, 
    0x21, 0x90, 0x10, 0x48, 0x08, 0x24, 0x04, 0x22, 0x01, 0x60, 0x00, 0x3E, 0x80, 0x24, 0x20, 0x21, 
    0x90, 0x10, 0x48, 0x08, 0x24, 0x04, 0xE4, 0x01, 0x01, 0x80, 0x80, 0x40, 0x20, 0x20, 0x0C, 0x90, 
    0x01, 0x28, 0x00, 0x0C, 0x00, 0xDC, 0x01, 0x11, 0x81, 0x88, 0x40, 0x44, 0x20, 0x22, 0x10, 0x11, 
    0x70, 0x07, 0x78, 0x02, 0x42, 0x02, 0x21, 0x81, 0x90, 0x40, 0x48, 0x40, 0x12, 0xC0, 0x07, 0x60, 
    0x0C, 0x30, 0x06, 0x00, 0x08, 0x8C, 0x03, 0xC6, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x03, 0x40, 0x02, 
    0x20, 0x01, 0x90, 0x00, 0x84, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x80, 0x04, 0x40, 0x02, 0x20, 
    0x01, 0x90, 0x00, 0x84, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x00, 
    0x04, 0x00, 0x01, 0x80, 0xD8, 0x40, 0x02, 0xC0, 0x00, 0x80, 0x0F, 0x30, 0x18, 0x0C, 0x18, 0xE2, 
    0x08, 0x89, 0x84, 0x45, 0x82, 0x3F, 0x00, 0x30, 0x00, 0x0F, 0x70, 0x02, 0x04, 0x01, 0x9C, 0x00, 
    0xF0, 0x00, 0xC0, 0xC0, 0x7F, 0x20, 0x22, 0x10, 0x11, 0x88, 0x08, 0x44, 0x04, 0x22, 0x02, 0xEE, 
    0x00, 0x3E, 0x80, 0x20, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x01, 0xFF, 0x81, 
    0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x10, 0x04, 0xF0, 0x01, 0xFE, 0x03, 0x11, 0x81, 0x88, 
    0x40, 0x44, 0x20, 0x22, 0x10, 0x11, 0x88, 0x08, 0xFC, 0x07, 0x22, 0x00, 0x11, 0x80, 0x08, 0x40, 
    0x04, 0x20, 0x02, 0x10, 0x01, 0xE0, 0x03, 0x08, 0x02, 0x02, 0x02, 0x01, 0x81, 0x80, 0x40, 0x44, 
    0x40, 0x1E, 0xF0, 0x1F, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0xC0, 0x7F, 0x20, 
    0x20, 0x10, 0x10, 0xF8, 0x0F, 0x04, 0x04, 0x02, 0x02, 0x80, 0x00, 0x80, 0x40, 0x40, 0x20, 0x20, 
    0xF0, 0x0F, 0xF8, 0x0F, 0x40, 0x00, 0x30, 0x00, 0x24, 0x00, 0x61, 0x40, 0x40, 0xE0, 0x3F, 0x00, 
    0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0xC0, 0x7F, 0x60, 0x00, 0xC0, 0x01, 
    0x00, 0x01, 0x70, 0x00, 0x06, 0x00, 0xFF, 0x81, 0xFF, 0xC0, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 
    0x03, 0x00, 0x06, 0xFE, 0x03, 0x7C, 0x00, 0x41, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x10, 0x04, 
    0xF0, 0x01, 0xFE, 0x03, 0x21, 0x80, 0x10, 0x40, 0x08, 0x20, 0x04, 0x10, 0x02, 0xF0, 0x00, 0xF0, 
    0x01, 0x04, 0x01, 0x01, 0x81, 0x80, 0x40, 0xC0, 0x40, 0xD0, 0xC0, 0x07, 0xF8, 0x0F, 0x44, 0x00, 
    0x22, 0x00, 0x11, 0x80, 0x18, 0x40, 0x34, 0xC0, 0x21, 0xE0, 0x08, 0x88, 0x08, 0x44, 0x04, 0x22, 
    0x02, 0x11, 0x81, 0x88, 0x80, 0x38, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0xFC, 0x07, 0x02, 0x00, 
    0x01, 0x80, 0x00, 0xC0, 0x3F, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0xFF, 
    0x80, 0x01, 0x80, 0x07, 0x00, 0x1C, 0x00, 0x10, 0x00, 0x07, 0x78, 0x00, 0x06, 0x00, 0x07, 0x00, 
    0xFC, 0x00, 0x30, 0x00, 0x07, 0x00, 0x0C, 0xC0, 0x0F, 0x1C, 0x00, 0x02, 0x02, 0x83, 0x01, 0x36, 
    0x00, 0x04, 0x80, 0x0D, 0x30, 0x18, 0x08, 0x08, 0x04, 0x00, 0x04, 0x00, 0x0C, 0x00, 0xF8, 0x00, 
    0x03, 0x40, 0x00, 0x10, 0x00, 0x08, 0x0C, 0x04, 0x05, 0x42, 0x02, 0x11, 0x81, 0x84, 0x40, 0x41, 
    0x60, 0x20, 0xFC, 0x3F, 0x02, 0x10, 0x01, 0x08, 0x02, 0x00, 0x06, 0x00, 0x1C, 0x00, 0x30, 0x00, 
    0x60, 0x00, 0x40, 0x02, 0x10, 0x01, 0x88, 0xFF, 0x07, 0x08, 0x00, 0x02, 0x80, 0x00, 0x20, 0x00, 
    0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x7C, 0x80, 0xFF, 0xC0, 0x7F, 0x80, 0x0F, 0x00, 
    0x01, 0x33, 0xB3, 0x99, 0x19, 0x33, 0x93, 0x99, 0x39, 0x33, 0x9B, 0x99, 0x31, 0x33, 0x99, 0x99, 
    0xFC, 0x01, 0x10, 0x00, 0x08, 0x80, 0x3F, 0x00, 0x08, 0x00, 0xFC, 0x00, 0x02, 0x00, 0x01, 0xFC, 
    0x01, 0x12, 0x00, 0x09, 0x80, 0xF8, 0x03, 0x24, 0x00, 0x12, 0x00, 0x01, 0xF0, 0x01, 0x04, 0x01, 
    0x82, 0x00, 0x41, 0x00, 0xF9, 0x03, 0x24, 0x00, 0x32, 0x00, 0x66, 0xF8, 0x03, 0x00, 0x01, 0x80, 
    0x00, 0x40, 0x00, 0xF8, 0x03, 0x24, 0x00, 0x12, 0x00, 0x01, 0x60, 0x00, 0x48, 0x00, 0x24, 0x00, 
    0x0C, 0x00, 0x10, 0x01, 0x88, 0x00, 0x44, 0x80, 0x2F, 0x00, 0x11, 0x80, 0x08, 0x40, 0x04, 0x7F, 
    0x00, 0x03, 0x00, 0x06, 0xE0, 0x0F, 0x00, 0x7E, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x03, 0x00, 
    0x0F, 0x00, 0x18, 0xC0, 0x07, 0x30, 0x02, 0x00, 0x3F, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 
    0x00, 0x08, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 
    0x08, 0x00, 0xFC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0xFC, 0x03, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 
    0x07, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0xF8, 0xFF, 
    0x03, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 
    0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 
    0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 
    0x01, 0x80, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 
    0x00, 0x08, 0x00, 0x04, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 
    0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x03, 0x02, 0x00, 0x01, 0x80, 0x00, 
    0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0xF8, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0xF8, 0x07, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 
    0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0xFC, 0x03, 0x02, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 
    0x30, 0x01, 0x98, 0x00, 0x52, 0x00, 0x29, 0x80, 0x14, 0x20, 0x0C, 0x10, 0x06, 0x90, 0x02, 0x48, 
    0x01, 0xA4, 0x00, 0x4C, 0x00, 0x26, 0x00, 0x13, 0x40, 0x08, 0x10, 0x04, 0xF8, 0x01, 0x04, 0x00, 
    0xFE, 0x00, 0x01, 0x80, 0x00, 0x80, 0x04, 0x40, 0x0A, 0x20, 0x03, 0xF0, 0x00, 0x4C, 0x00, 0x25, 
    0x00, 0x12, 0x00, 0x20, 0x00, 0x11, 0xF0, 0x0F, 0x44, 0x04, 0x22, 0x02, 0x01, 0x01, 0x0C, 0x00, 
    0x0F, 0x80, 0x07, 0x80, 0x01
};
/* }}} */

/* sorted like enum fonts
 * fonttable[FONT_LATIN1] = {&font_latin1, &font_latin1_bold} */
const __flash uint8_t * const __flash fonttable[MAX_FONTS][2] = {
	{font_c0, font_c0},
	{font_c1, font_c1},
	{font_ascii, font_ascii_bold},
	{font_latin1, font_latin1_bold},
	{font_graphic, font_graphic},
};

/** @brief reset font mapping to initial state */
void font_reset(void)
{ /* {{{ */
	fontselected[G0] = FONT_ASCII;
	fontselected[G1] = FONT_ASCII;
	fontselected[G2] = FONT_LATIN1;
	fontselected[G3] = FONT_LATIN1;

	fontactive[GL] = G0;
	fontactive[GR] = G2;

	glssreturn = NO_SS;
} /* }}} */

/** @brief map a selected font into an active slot
 * @param active put selected font in this slot
 * @param select selected font to activate */
void font_set_active(enum activeslot active, enum selectslot select)
{ /* {{{ */
	if (MAX_ACTIVE <= active || MAX_SELECT <= select)
		return;
	fontactive[active] = select;
} /* }}} */

/** @brief map a font into a select slot
 * @param select put the font in this slot
 * @param font font to select */
void font_set_selected(enum selectslot select, enum fonts font)
{ /* {{{ */
	if (MAX_SELECT <= select || MAX_FONTS <= font)
		return;
	fontselected[select] = font;
} /* }}} */

/** @brief map the selected font into GL for a single character
 * @param select selected font */
void font_set_singleshift(enum selectslot select)
{ /* {{{ */
	glssreturn = fontactive[GL];
	fontactive[GL] = select;
} /* }}} */

/** @brief save currently active and selected fonts */
void font_save_state(void)
{ /* {{{ */
	glsave = fontactive[GL];
	grsave = fontactive[GR];
	glsssave = glssreturn;
} /* }}} */

/** @brief restore saved fonts */
void font_restore_state(void)
{ /* {{{ */
	fontactive[GL] = glsave;
	fontactive[GR] = grsave;
	glssreturn = glsssave;
} /* }}} */

/** @brief get selected slot in active slot
 *
 * after calling this function with GL, a single shift is seen as completed and
 * therefore restores the selected font before the single shift.
 *
 * @param active the active slot
 * @return selected slot */
enum selectslot font_get_selected(enum activeslot active)
{ /* {{{ */
	enum selectslot ret = fontactive[active];
	if (active == GL && glssreturn != NO_SS) {
		fontactive[GL] = glssreturn;
		glssreturn = NO_SS;
	}
	return ret;
} /* }}} */

/** @brief get font from selected slot
 * @param select the selected slot
 * @return font in selected slot */
enum fonts font_get_font(enum selectslot select)
{
	enum fonts ret = fontselected[select];
	return ret;
}

/** @brief number of characters in font
 * @param font the font
 * @return number of characters in the font */
uint_fast8_t font_get_setwidth(enum fonts font)
{
	return fonttable[font][0][6]-(fonttable[font][0][5]-1);
}

/** @brief draw a character at positon
 * @param x column
 * @param y line
 * @param cb pointer to charbuf */
void font_draw_char(uint_fast8_t x, uint_fast8_t y, struct charbuf *cb)
{ /* {{{ */
	const __flash uint8_t *curfont = fonttable[cb->font][cb->bold];

	uint_fast16_t rgb656fg, rgb656bg;
	uint_fast8_t firstchar = curfont[5];
	uint_fast8_t lastchar = curfont[6];

	uint_fast8_t bitoffset, mask, charwidth, byte, leftspace, rightspace;
	uint_fast16_t bcounter, bitsbischar, bytesbischar;

	rgb656fg = color_get_rgb656(cb->fgcolor);
	rgb656bg = color_get_rgb656(cb->bgcolor);

	if (((cb->ch) < firstchar) || ((cb->ch) > lastchar)) {
		cb->ch = 0x1A; /* SUB */
		curfont = fonttable[FONT_C0][0];
		firstchar = curfont[5];
		lastchar = curfont[6];
	}

	charwidth = curfont[FONT_HEADER_SIZE + (cb->ch) - firstchar];
	if (charwidth == 0) {
		cb->ch = 0x1A; /* SUB */
		curfont = fonttable[FONT_C0][0];
		firstchar = curfont[5];
		lastchar = curfont[6];
		charwidth = curfont[FONT_HEADER_SIZE + cb->ch - firstchar];
	}

	leftspace = FONT_WIDTH - charwidth;
	rightspace = leftspace/2;
	leftspace -= rightspace;

	lcd_set_window((x*FONT_WIDTH),(y*FONT_HEIGHT),
			((x+1)*FONT_WIDTH)-1, ((y+1)*FONT_HEIGHT)-1);

	while (leftspace > 0) {
		for (uint_fast8_t i=0;i < FONT_HEIGHT; i++) {
			if (cb->underline && i == FONT_UNDERLINE_POS) {
				lcd_write_data(rgb656fg);
			} else {
				lcd_write_data(rgb656bg);
			}
		}
		leftspace--;
	}

	byte = 0;
	bcounter = 0;
	bitsbischar = 0;

	for (uint_fast8_t i=0;i< cb->ch-firstchar; i++) {
		bitsbischar += curfont[FONT_HEADER_SIZE + i];
	}

	bitsbischar *= FONT_HEIGHT;
	bitsbischar += ((lastchar-firstchar)+FONT_HEADER_SIZE)*8;
	bytesbischar = bitsbischar/8;
	bitoffset = bitsbischar % 8;
	mask = bitoffset % 8;

	for (uint_fast8_t px=0; px<charwidth; px++) {
		for (uint_fast8_t py=0; py<FONT_HEIGHT; py++) {
			if(mask > 7) {
				mask = 0;
				bcounter++;
			}
			byte = curfont[bytesbischar+bcounter+1];
			if((byte & (1<<mask)) ||
					(cb->underline && py == FONT_UNDERLINE_POS) ) {
				lcd_write_data(rgb656fg);
			} else {
				lcd_write_data(rgb656bg);
			}
			mask++;
		}
	}

	while (rightspace > 0) {
		for (uint_fast8_t i=0;i < FONT_HEIGHT; i++) {
			if (cb->underline && i == FONT_UNDERLINE_POS) {
				lcd_write_data(rgb656fg);
			} else {
				lcd_write_data(rgb656bg);
			}
		}
		rightspace--;
	}
} /* }}} */

/* vim:set foldmethod=marker: */
